home *** CD-ROM | disk | FTP | other *** search
/ Champak 109 / Vol 109.iso / games / javelin.swf / scripts / __Packages / CRat.as < prev    next >
Text File  |  2008-11-12  |  2KB  |  104 lines

  1. class CRat
  2. {
  3.    var CS = 0.86;
  4.    var LNG_RUN = 1340 * CRat.prototype.CS;
  5.    var VV = 60;
  6.    var FF = 6000;
  7.    var DD = 3;
  8.    var strVFD = [60,5000,3];
  9.    var stV = [60,70,50];
  10.    var stF = [6000,5000,7000];
  11.    var stD = [3,3,5];
  12.    var minV = [0.15,0.5,0.2];
  13.    var minF = [150,100,50];
  14.    var minD = [0.02,0.02,0.04];
  15.    var STEP_ADDSPD = 10;
  16.    var SPD_PRIR = 0.048;
  17.    var ADD_TO_USK = 0.006;
  18.    function CRat()
  19.    {
  20.       this.pxl_run = 0;
  21.       this.step_dx = 7;
  22.       this.add_spd = this.STEP_ADDSPD;
  23.       this.leg_run = false;
  24.       this.id_nf = 1;
  25.       this.chg_frm = 0;
  26.       this.cnt_tikrun = 0;
  27.       this.dx_usk = 0.533;
  28.       this.now_frm = 0;
  29.       this.length_fly = 0;
  30.       this.spd_V = 0;
  31.       this.otdih = 30;
  32.       this.max_record = 0;
  33.       this.rtype = 0;
  34.    }
  35.    function SetDefault()
  36.    {
  37.       this.pxl_run = 0;
  38.       this.step_dx = 7;
  39.       this.leg_run = false;
  40.       this.id_nf = 1;
  41.       this.chg_frm = 0;
  42.       this.cnt_tikrun = 0;
  43.       this.dx_usk = 0.533;
  44.       this.now_frm = 0;
  45.       this.length_fly = 0;
  46.       this.spd_V = 0;
  47.    }
  48.    function onTimer()
  49.    {
  50.       this.step_dx += this.SPD_PRIR;
  51.       if(this.pxl_run < this.LNG_RUN * 0.8)
  52.       {
  53.          this.spd_V += this.spd_ADD1;
  54.       }
  55.       else
  56.       {
  57.          this.spd_V += this.spd_ADD2;
  58.       }
  59.    }
  60.    function onTimerZamedl()
  61.    {
  62.       if(this.step_dx - 0.4 > 0)
  63.       {
  64.          this.step_dx -= 0.4;
  65.       }
  66.       else
  67.       {
  68.          this.step_dx = 0;
  69.       }
  70.    }
  71.    function SetSpeedPrir()
  72.    {
  73.       this.spd_V = 0;
  74.       this.spd_ADD1 = this.VV * 0.0028;
  75.       this.spd_ADD2 = this.VV * 0.037;
  76.    }
  77.    function SetStartParamOfType()
  78.    {
  79.       if(this.rtype == 0)
  80.       {
  81.          this.VV = this.stV[0];
  82.          this.FF = this.stF[0];
  83.          this.DD = this.stD[0];
  84.       }
  85.       else if(this.rtype == 1)
  86.       {
  87.          this.VV = this.stV[1];
  88.          this.FF = this.stF[1];
  89.          this.DD = this.stD[1];
  90.       }
  91.       else if(this.rtype == 2)
  92.       {
  93.          this.VV = this.stV[2];
  94.          this.FF = this.stF[2];
  95.          this.DD = this.stD[2];
  96.       }
  97.    }
  98.    function SetDefParam()
  99.    {
  100.       this.SetStartParamOfType();
  101.       this.max_record = 0;
  102.    }
  103. }
  104.